/*
 * Tezad - Classic puzzle game
 * Copyright 2009 Shayne Riley and Paul Maseberg
 *
 * Tezad is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Tezad is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tezad.  If not, see <http://www.gnu.org/licenses/>
 * or write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * To contact the authors on questions or issues regarding the license,
 * you may send an email to <pezads at gmail dot com>
 */

#ifndef SUBJECT_H_
#define SUBJECT_H_

#include <list>
#include "callback.h"
#include "Command.h"

class Subject
{
public:
    virtual ~Subject();

    virtual void attach(Functor1<Command&> observer);
    virtual void detach(Functor1<Command&> observer);
    virtual void notify(Command &command);
protected:
    Subject();
private:
    std::list<Functor1<Command&> > observers;
};

#endif /* SUBJECT_H_ */
